package ModelLayer;
import java.util.HashMap;

/**
 * Write a description of class rentalContainer here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class RentalContainer
{
    private static RentalContainer instance = null;
    private HashMap<Integer, Machine> machines;
    private static int machineNo = 1;

    private RentalContainer()
    {
        machines = new HashMap<Integer, Machine>();
    }
      
    public int getMachineNo()
    {
        return machineNo++;
    }
    
    public static RentalContainer getInstance()
    {
        if (instance == null)
        {
            instance = new RentalContainer();
        }
        return instance;
    }
    
    public Machine getMachine(int machineNo)
    {
        return machines.get(machineNo);
    }
    
    public HashMap<Integer, Machine> getRental()
    {
        return machines;
    }
    
    public void addMachine(int machineNo, Machine machine)
    {
        // adds machine to rentalContainer and set mac as the machine
        Machine mac = machines.put(machineNo, machine);
        // if machine mac wasn't added to rentalContainer, 
    }
    
    public void removeMachine(int machineNo)
    {
        machines.remove(machineNo);
    }
    
    public Machine findMachineByMachineNo(int machineNo)
    {
        Machine machine = machines.get(machineNo);
        return machine;
    }
    
}
